package kz.kstu.scantest.facade.ejb.impl;

import kz.kstu.scantest.business.common.exception.KeyAlreadyExists;
import kz.kstu.scantest.business.entity.Key;
import kz.kstu.scantest.business.server.api.AuditService;
import kz.kstu.scantest.facade.ejb.api.AuditFacade;

import javax.ejb.Stateless;

/**
 * @author Filipp_Stankevich
 *         created 02.09.12 21:52
 */
@Stateless
public class AuditFacadeBean extends AbstractFacadeBean implements AuditFacade {


    @Override
    public Integer getProcessedFormDataCount() {
        return getService(AuditService.class).getProcessedFormDataCount();
    }

    @Override
    public void changeStatistic(Integer count) {
        getService(AuditService.class).changeStatistic(count);
    }

    @Override
    public void saveKey(Key key) throws KeyAlreadyExists  {
        getService(AuditService.class).saveKey(key);
    }

    @Override
    public Key findLastKey() {
        return getService(AuditService.class).findLastKey();
    }
}
